package com.xiaoma.test;

import com.xiaoma.api.HelloObject;
import com.xiaoma.api.HelloService;
import com.xiaoma.client.RpcClientProxy;
import com.xiaoma.netty.client.NettyClient;

/**
 * @Author: xiaoma
 * @Date: 2021/7/5 16:11
 * @description:
 */
public class NettyTestClient {
    public static void main(String[] args) {
        NettyClient nettyClient = new NettyClient();
        RpcClientProxy proxy = new RpcClientProxy(nettyClient);
        HelloService helloService = proxy.getProxy(HelloService.class);
        HelloObject helloObject = new HelloObject(1, "netty  to say hello!~~~");
//        for(int i = 0; i < 20; i ++) {
            String res = helloService.hello(helloObject);
            System.out.println(res);
//        }
    }
}
